#!/usr/bin/env python
# -*- coding:utf-8 -*-
# 行政区划分


def xzq(name):
    url = 'https://restapi.amap.com/v3/config/district?keywords=%s&subdistrict=2&key=c4b32eae143cec8794b9fbede332cdde&output=json'%name

    import requests

    poo = requests.get(url)
    data = poo.json()
    if not data.get('districts'):
        return ''
    dat2 = []
    for i in data['districts'][0]['districts'][0]['districts']:
        print(i)
        dat2.append(i['name'])
        dat2.append(',')
        dat2.append(i['center'])
        dat2.append('\n')


    return ''.join(dat2)
